package net.googlecode.demenkov.dao;

import net.googlecode.demenkov.domains.Person;

/**
 * DAO-interface for actions with student's person
 *
 * @author Demenkov Yura
 */
public interface PersonDAO extends GenericDAO<Person, Integer> {
    /**
     * Finds person by it's email in database
     *
     * @param email of person
     * @return person, if there is such email in database, or null, if there is no
     */
    public Person findPersonByEmail(String email);

    /**
     * Creates vote fromPerson toPerson
     *
     * @param fromPerson who votes
     * @param toPerson   who is voted for
     */
    public void createVote(Person fromPerson, Person toPerson);

    /**
     * Deletes vote from database from fromPerson for toPerson
     *
     * @param fromPerson person who voted
     * @param toPerson   person who was voted for
     */
    public void deleteVote(Person fromPerson, Person toPerson);
}
